package com.timothy.business.controller;

import org.apache.shiro.SecurityUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.timothy.business.model.ResultMessage;
import com.timothy.business.util.ResultMessageHelper;
import com.timothy.remote.core.UserEntity;

@RestController
@RequestMapping("/sys/user")
public class SysUserController {

	/**
	 * 获取登录的用户信息
	 */
	@RequestMapping("/info")
	public ResultMessage<UserEntity> info() {
		UserEntity userInfo = (UserEntity) SecurityUtils.getSubject().getPrincipal();
		return ResultMessageHelper.successResult(userInfo);
	}

}
